<html>
<head><meta charset="utf-8"><title>Go to anywhere action · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html">Go to anywhere action</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="186180091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186180091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186180091">(Jan 21 2020 at 13:03)</a>:</h4>
<p>Every now and then (especially when I see a complex inlay hint), I want to open a file with a declaration of the specifically named enum/trait/struct/method, either in the project code or in some dependency's.</p>
<p>Intellij Rust achieves this by providing "Go to anywhere" action: it's basically a text input with a panel that displays the search results based on the input.</p>
<p>It feels like RA is with its <code>symbol_index::world_symbols</code> from ra_ide has everything we need to suppord this kind of functionality.</p>
<p>Am I right or is there something I've missed?<br>
Does it make sense to implement this feature?<br>
Does LSP support this on the API level or should we come up with some custom action again?</p>



<a name="186180495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186180495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Emil Lauridsen <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186180495">(Jan 21 2020 at 13:08)</a>:</h4>
<p>VSCode has "Go to Symbol in Workspace..." which works decently right now,  although it's a little tricky with regards to how it returns types or functions. Not sure how it works LSP wise</p>



<a name="186180734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186180734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186180734">(Jan 21 2020 at 13:11)</a>:</h4>
<p>Yeah, no methods resolved and no results shown for the dependencies.<br>
I wonder if that can be improved somehow.</p>



<a name="186180740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186180740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186180740">(Jan 21 2020 at 13:11)</a>:</h4>
<p>Thank you for <code>Go to Symbol in Workspace</code> reference, I always used just a simple project-wide text search for that task xD</p>



<a name="186180869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186180869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Emil Lauridsen <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186180869">(Jan 21 2020 at 13:13)</a>:</h4>
<blockquote>
<p>Yeah, no methods resolved and no results shown for the dependencies.<br>
I wonder if that can be improved somehow.</p>
</blockquote>
<p>It will resolve functions but only when your search becomes "specific enough", and at that point it seems like it only returns functions.</p>



<a name="186181097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186181097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186181097">(Jan 21 2020 at 13:16)</a>:</h4>
<p>Indeed.<br>
Well, that's something I can live with already, thank you :)</p>



<a name="186181243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186181243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186181243">(Jan 21 2020 at 13:18)</a>:</h4>
<p>I think there are special characters you can append to search in functions and/or dependencies, one of them was <code>#</code>, I don't remember the other one</p>



<a name="186181409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186181409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Emil Lauridsen <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186181409">(Jan 21 2020 at 13:20)</a>:</h4>
<blockquote>
<p>I think there are special characters you can append to search in functions and/or dependencies, one of them was <code>#</code>, I don't remember the other one</p>
</blockquote>
<p>The symbols modify behavior of the file picker:<code>#</code> is workspace wide, <code>@</code> is current file, not sure if there's equivalents to search for specific kinds of things in those scopes.</p>



<a name="186181427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186181427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186181427">(Jan 21 2020 at 13:20)</a>:</h4>
<p>Looks like those are the options available:</p>
<p><a href="/user_uploads/4715/s1w38wcUGuUvvmW8L3xLxOHU/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/s1w38wcUGuUvvmW8L3xLxOHU/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/s1w38wcUGuUvvmW8L3xLxOHU/pasted_image.png"></a></div>



<a name="186182147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186182147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186182147">(Jan 21 2020 at 13:28)</a>:</h4>
<p>no, I was thinking of this: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/features.md#workspace-symbol-ctrlt" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/features.md#workspace-symbol-ctrlt">https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/features.md#workspace-symbol-ctrlt</a></p>



<a name="186182818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186182818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186182818">(Jan 21 2020 at 13:37)</a>:</h4>
<p><span class="user-mention" data-user-id="231447">@Kirill Bulatov</span> you can append <code>#</code> and <code>*</code> symbols to the symbols query to get symbols from dependeices / symbols including the function</p>



<a name="186183200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186183200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186183200">(Jan 21 2020 at 13:41)</a>:</h4>
<p>Lovely, now I get all I need. <br>
Thank you all.</p>



<a name="186195327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186195327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186195327">(Jan 21 2020 at 15:45)</a>:</h4>
<p>Recorded a demo: <a href="https://twitter.com/rust_analyzer/status/1219647139149754368" target="_blank" title="https://twitter.com/rust_analyzer/status/1219647139149754368">https://twitter.com/rust_analyzer/status/1219647139149754368</a></p>
<div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/rust_analyzer/status/1219647139149754368" target="_blank"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1217461647377420289/HXHa6hZU_normal.jpg"></a><p>Little known feature of rust-analyzer: in symbol search, you can use # to search for functions and fields (the default is type) and use * to search across dependencies.

Would love to see first class support for this in LSP! <a href="https://t.co/3G2akBULG0" target="_blank" title="https://t.co/3G2akBULG0">https://twitter.com/rust_analyzer/status/1219647139149754368/photo/1</a></p><span>- rust-analyzer (@rust_analyzer)</span></div></div>



<a name="186894585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186894585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186894585">(Jan 29 2020 at 15:18)</a>:</h4>
<p>Getting back there.<br>
Is this feature something that we implement?</p>
<p>I find it a bit confusing that there's no <code>std::sync::Arc</code> in the results:<br>
<a href="/user_uploads/4715/EUcfiiDCLDzqNiOo4kgjLecx/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a> </p>
<div class="message_inline_image"><a href="/user_uploads/4715/EUcfiiDCLDzqNiOo4kgjLecx/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/EUcfiiDCLDzqNiOo4kgjLecx/pasted_image.png"></a></div><p>Also there are no results for the <code>std::io::Read</code> for some reason:<br>
<a href="/user_uploads/4715/H5lp7jZiWhNCYDc504zUa0Sz/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/H5lp7jZiWhNCYDc504zUa0Sz/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/H5lp7jZiWhNCYDc504zUa0Sz/pasted_image.png"></a></div>



<a name="186894812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186894812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186894812">(Jan 29 2020 at 15:20)</a>:</h4>
<p>"the same reason" we show only the original struct and not the reexport?</p>



<a name="186894843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186894843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186894843">(Jan 29 2020 at 15:20)</a>:</h4>
<p>Right, reexports.</p>
<p>But what's up with <code>Read</code>?</p>



<a name="186897237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186897237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186897237">(Jan 29 2020 at 15:42)</a>:</h4>
<p>Hm, my guess would be that it collides with lowercase <code>read</code> method</p>



<a name="186897262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186897262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186897262">(Jan 29 2020 at 15:43)</a>:</h4>
<p>I think we've fixed that a long time ago, but maybe not fully</p>



<a name="186897286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186897286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186897286">(Jan 29 2020 at 15:43)</a>:</h4>
<p>(we store lowercased names in the index)</p>



<a name="186897405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186897405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186897405">(Jan 29 2020 at 15:44)</a>:</h4>
<p>The relevant file to look into is <code>symbol_index</code> (I highly recommend checking it and the underlying fst crate out, it's good stuff)</p>



<a name="186898763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Go%20to%20anywhere%20action/near/186898763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Go.20to.20anywhere.20action.html#186898763">(Jan 29 2020 at 15:57)</a>:</h4>
<p>Thanks for the pointers.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>